<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %><%--jstl을 쓰기 위해 사용 --%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %><%--숫자 포맷을 사용하기 위해 사용 --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"  prefix="fn"%><%--함수들을 이용하기 위해 사용 --%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="css/style.css" type="text/css"></link>
<script type="text/javascript" src="script/sms_util_script.js"></script>
<!--<script type="text/javascript" src="script/sms_asset_script.js"></script>-->
<script type="text/javascript">
//js파일로 넣으면 el,jstl값을 못읽어옴
//자산유형별 추가 테이블 변경 스크립트
function changeAddTable(assetBaseListSize){
	var size=parseInt(assetBaseListSize);
	var assetNo=document.getElementById("asset_no").value;
	var divControl=document.getElementById(assetNo);
	document.getElementById(assetNo).style.display="";
	for(i=1;i<=size;i++){
		if(assetNo!=i){
			document.getElementById(i).style.display="none";
			document.getElementById(i).innerHTML="";
		}
	}
	if(assetNo==1 || assetNo==2){
		divControl.innerHTML="<table class='tb06' border='0' cellpadding='0' cellspacing='1'>"
				+"<tr height='25px'>"
					+"<th class='cal' rowspan='4' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_goal}"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>제품명</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_prod}"
					+"</td>"
				+"</tr>"
				+"<tr height='25px'>"
					+"<th width='80px' align='center' class='cal'>서비스 범위</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_service}"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>사용 OS</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_os}"
					+"</td>"
				+"</tr>"
				+"<tr height='25px'>"
					+"<th width='80px' align='center' class='cal'>제조업체</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_make}"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>호스트명</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_host}"
					+"</td>"
				+"</tr>"
				+"<tr height='25px'>"
					+"<td colspan='2'></td>"
					+"<th width='80px' align='center' class='cal'>IP</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_ip}"
					+"</td>"
				+"</tr>"
			+"</table>";
	}else if(assetNo==3){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
			+"<tr height='25px'>"
				+"<th class='cal' rowspan='4' width='60px'>추가사항</th>"
				+"<th width='80px' align='center' class='cal'>목적/기능</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_goal}"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>제품명</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_prod}"
				+"</td>"
			+"</tr>"
			+"<tr height='25px'>"
				+"<th width='80px' align='center' class='cal'>펌 웨어 버전</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_firm}"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>사용 OS</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_os}"
				+"</td>"
			+"</tr>"
			+"<tr height='25px'>"
				+"<th width='80px' align='center' class='cal'>제조업체</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_make}"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>호스트명</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_host}"
				+"</td>"
			+"</tr>"
			+"<tr height='25px'>"
				+"<td colspan='2'></td>"
				+"<th width='80px' align='center' class='cal'>IP</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_ip}"
				+"</td>"
			+"</tr>"
		+"</table>";
	}else if(assetNo==4){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
				+"<tr height='25px'>"
					+"<th class='cal' rowspan='2' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_goal}"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>현업/개발</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_devel}"
					+"</td>"
				+"</tr>"
				+"<tr height='25px'>"
					+"<td colspan='2'></td>"
					+"<th width='80px' align='center' class='cal'>인증방식</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_ipin}"
					+"</td>"
				+"</tr>"
			+"</table>";
	}else if(assetNo==5){
			divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
				+"<tr height='25px'>"
					+"<th class='cal' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_goal}"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>제조업체</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_make}"
					+"</td>"
				+"</tr>"
			+"</table>";
	}else if(assetNo==6){
			divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
				+"<tr height='25px'>"
					+"<th class='cal' rowspan='2' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_goal}"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>사용OS</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_os}"
					+"</td>"
				+"</tr>"
				+"<tr height='25px'>"
					+"<td colspan='2'></td>"
					+"<th width='80px' align='center' class='cal'>해당팀</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_team}"
					+"</td>"
				+"</tr>"
			+"</table>";
	}else if(assetNo==7){
			divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
				+"<tr height='25px'>"
					+"<th class='cal' rowspan='2' width='60px'>추가사항</th>"
					+"<th width='80px' align='center' class='cal'>목적/기능</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_goal}"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>제/개정 일자</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_kdate}"
					+"</td>"
				+"</tr>"
				+"<tr height='25px'>"
					+"<th width='80px' align='center' class='cal'>보존연한</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_save}"
					+"</td>"
					+"<th width='80px' align='center' class='cal'>보관서버<br/>(독립서버)</th>"
					+"<td align='left'  width='150px'>"
					+"${ovo.a_singlesrv}"
					+"</td>"
				+"</tr>"
			+"</table>";
	}else if(assetNo==8){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
			+"<tr height='25px'>"
				+"<th class='cal' rowspan='3' width='60px'>추가사항</th>"
				+"<th width='80px' align='center' class='cal'>이름</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_name}"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>소속</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_company}"
				+"</td>"
			+"</tr>"
			+"<tr height='25px'>"
				+"<th width='80px' align='center' class='cal'>직책/직급</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_job}"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>담당업무</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_takejob}"
				+"</td>"
			+"</tr>"
			+"<tr height='25px'>"
				+"<td colspan='2'></td>"
				+"<th width='80px' align='center' class='cal'>부서장</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_subking}"
				+"</td>"
			+"</tr>"
		+"</table>";
	}else if(assetNo==9){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
			+"<tr height='25px'>"
				+"<th class='cal' rowspan='2' width='60px'>추가사항</th>"
				+"<th width='80px' align='center' class='cal'>제조업체</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_make}"
				+"</td>"
				+"<th width='80px' align='center' class='cal'>수량</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_pcnt}"
				+"</td>"
			+"</tr>"
			+"<tr height='25px'>"
				+"<td colspan='2' width='230px'></td>"
				+"<th width='80px' align='center' class='cal'>도입 년월일</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_sdate}"
				+"</td>"
			+"</tr>"
		+"</table>";
	}else if(assetNo==10){
		divControl.innerHTML="<table class='tb06' border='1' cellpadding='0' cellspacing='1'>"
			+"<tr height='25px'>"
				+"<th class='cal' width='60px'>추가사항</th>"
				+"<td colspan='2' width='231px'></td>"
				+"<th width='80px' align='center' class='cal'>기밀등급</th>"
				+"<td align='left'  width='150px'>"
				+"${ovo.a_security}"
				+"</td>"
			+"</tr>"
		+"</table>";
	}else{
		//자산유형 10개까지만 테이블 만들었음
		divControl.innerHTML="";
	}
}
</script>
</head>
<body onload="javascript: changeAddTable('${fn:length(assetBaseList)}'); javascript: ciaSum()">
	<table width="100%"  border="0" cellspacing="0" cellpadding="1">
		<tr>
			<th bgcolor="#cff8ff" valign="center" height="40px" align="center"><font size="4">자산 평가</font></th>
		</tr>
		<tr>
			<td height="15px"></td>
		</tr>
		<tr>
		<!-- 내용 테이블 -->
		<td align="center">
				<form action="assetAction.do" method="post" name="assetResult">
					<input type="hidden" name="mode" value="assetResult_update"></input>
					<!-- 자산 평가 페이지에서는 자산 코드를 따로 값을 넣는 공간이 없으니 히든값으로 넘겨줌 -->
					<input type="hidden" name="a_cd" value=${avo.a_cd }></input>
					<table class="tb06" border="0" cellpadding="0" cellspacing="0" >
						<tr height="20px">
							<th class="cal" rowspan="5" width="60px">기본사항</th>
							<th width="80px" align="center" class="cal">자산유형</th>
							<td align="left" width="150px" class="nopadtopbot">
								<select name="asset_no" id="asset_no" class="selectBox"  onchange="javascript: changeAddTable('${fn:length(assetBaseList)}')">
									<option value="${requestScope.assetNo }" selected>${requestScope.asset_kind }</option>
								</select>
							</td>
							<td align="right" colspan="2" class="nopadtopbot">
								<table border="0" cellspacing="0" cellpadding="0">
									<tr>
										 <td class="notline"><a href="#" onclick="javascript: assetWrite('assetResult')"><img src="img/save_btn.jpg" /></a></td>
										  <td class="notline"><a href="#" onclick="javascript: cancleWrite('assetResult_list')"><img src="img/cancel.gif" /></a></td>
									</tr>
								</table>								
							</td>
						</tr>
						<tr height="20px">
							<th width="80px" align="center" class="cal">자산코드</th>
							<td align="left">
								${avo.a_cd }
							</td>
							<th width="80px" align="center" class="cal">컨테이너</th>
							<td align="left"  width="150px">
								${avo.a_con }
							</td>
						</tr>
						<tr height="20px">
							<th width="80px" align="center" class="cal">자산명</th>
							<td align="left">																																																																										
								${avo.a_nm }
							</td>
							<th width="80px" align="center" class="cal">소유자</th>
							<td align="left">
								${avo.a_owner }
							</td>							
						</tr>
						<tr height="20px">
							<th width="80px" align="center" class="cal">수량</th>
							<td align="left">																																																												<!-- 특문체크&숫자만입력가능 -->		
								${avo.a_cnt }
							</td>
							<th width="80px" align="center" class="cal">관리자</th>
							<td align="left">
								${avo.a_admin }
							</td>
						</tr>
						<tr>
							<th width="80px" align="center" class="cal">자산위치</th>
							<td align="left">																
								${avo.a_loc }
							</td>
							<th width="80px" align="center" class="cal">업무프로세스</th>
							<td align="left" class="nopad">
								<select name="job_no" id="job_no" class="selectBox">
									<option value="${requestScope.jobNo }" selected>${requestScope.jobProcess }</option>
								</select>														
							</td>
						</tr>	
						<tr>
							<td class="nopad" height="5px" bgcolor="green" colspan="5"></td>
						</tr>
					</table>
					<!-- 추가테이블 부분 -->
				<c:forEach var="i" begin="1" end="${fn:length(assetBaseList)}">
					<div id="${i }" style="display:"></div>
				</c:forEach>				
					<!-- 추가테이블 끝 -->	
					<!-- 평가 테이블 -->
					<table class='tb06' border='0' cellpadding='0' cellspacing='1' >
						<tr>
							<td class="nopad" height="5px" bgcolor="green" colspan="5"></td>
						</tr>					
						<tr height='25px'>
							<th class='cal' rowspan='4' width="60px" >평가</th>
							<td colspan="2" class="notline" width="230px">
							<table class='tb06' border='0' cellpadding='0' cellspacing='0' width="100%">
							<colgroup>
								<col width="15%">
								<col width="15%">
								<col width="15%">
								<col width="15%">
								<col width="15%">
								<col width="15%">
							</colgroup>
							<thead>
							<tr>
								<th class='calnoleft'>C</th>
								<td>
									<select name="a_c" id="a_c" class="selectBox" onchange="javascript: ciaSum()">
										<c:forEach  var="scScoreList" items="${requestScope.scScoreList}" varStatus="status">
											<option <c:if test="${scScoreList.sc_score == requestScope.avo.a_c }">selected</c:if> value="${scScoreList.sc_score }">${scScoreList.sc_score }</option>
										</c:forEach>
									</select>
								</td>
								<th class='cal'>I</th>
								<td>
									<select name="a_i" id="a_i" class="selectBox" onchange="javascript: ciaSum()">
										<c:forEach  var="scScoreList" items="${requestScope.scScoreList}" varStatus="status">
											<option <c:if test="${scScoreList.sc_score == requestScope.avo.a_i }">selected</c:if> value="${scScoreList.sc_score }">${scScoreList.sc_score }</option>
										</c:forEach>
									</select>
								</td>
								<th class='cal'>A</th>
								<td class="noright">
									<select name="a_a" id="a_a" class="selectBox" onchange="javascript: ciaSum()">
										<c:forEach  var="scScoreList" items="${requestScope.scScoreList}" varStatus="status">
											<option <c:if test="${scScoreList.sc_score == requestScope.avo.a_a }">selected</c:if> value="${scScoreList.sc_score }">${scScoreList.sc_score }</option>
										</c:forEach>
									</select>
								</td>
							</tr>
							</thead>
							</table>
							</td>
							<th width='80px' align='center' class='cal'>총점</th>
							<td align='left'  width='150px'>
								<input type='text' name='cia_sum' id='cia_sum'  style="border:#bfbfbf 1px solid; background-color: #ffffff;"readonly="readonly" value="${avo.cia_sum }"></input>
							</td>
						</tr>
						<%--
						<tr height='25px'>
							<th width='80px' align='center' class='cal'>업무프로세스<br/>중요도</th>
							<td align='left'  width='150px'>
									<select name="job_score" id="job_score" class="selectBox" onchange="javascript: ciaSum()">
										<c:forEach  var="jobScoreList" items="${requestScope.jobScoreList}" varStatus="status">
											<option <c:if test="${jobScoreList.score == requestScope.avo.job_score }">selected</c:if> value="${jobScoreList.score }">${jobScoreList.score }</option>
										</c:forEach>
									</select>
							</td>
							<th width='80px' align='center' class='cal'>자산<br/>중요도 지수</th>
							<td align='left'  width='150px'>
								<input type='text' name='asset_score' id='asset_score'  style="border:#bfbfbf 1px solid; background-color: #ffffff;" readonly="readonly" value="${avo.asset_score }"></input>
							</td>
						</tr>
						 --%>
						<tr height='25px'>
							<td colspan='2'   width='230px'></td>
							<th width='80px' align='center' class='cal'>자산등급</th>
							<td align='left'  width='150px'>
								<input type='text' name='cia_kind' id='cia_kind' style='border:#bfbfbf 1px solid; background-color: #ffffff;' value="${avo.cia_kind }" readonly="readonly"></input>
							</td>
						</tr>
					</table>
					<!-- 평가 테이블  끝-->
					<!-- 평가 의견 테이블 -->
					<table class='tb06' border='0' cellpadding='0' cellspacing='1'>
						<tr>
							<td class="nopad" height="5px" bgcolor="green" colspan="6"></td>
						</tr>					
					<tr height='25px'>
						<th class='cal' width='60px' rowspan="3">추가사항</th>
						<th width='80px' align='center' class='cal'>기밀성(C)</th>
						<td width='392px'><textarea class="textfiled" name="result_c" rows="2" cols="70" id="result_c" style="border:#bfbfbf 1px solid; background-color: #ffffff;">${avo.result_c }</textarea></td>
					</tr>
					<tr>
						<th width='80px' align='center' class='cal'>무결성(I)</th>
						<td width='392px'><textarea class="textfiled" name="result_i" rows="2" cols="70" id="result_i" style="border:#bfbfbf 1px solid; background-color: #ffffff;">${avo.result_i }</textarea></td>
					</tr>
					<tr>
						<th width='80px' align='center' class='cal'>가용성(A)</th>
						<td width='392px'><textarea class="textfiled" name="result_a" rows="2" cols="70" id="result_a" style="border:#bfbfbf 1px solid; background-color: #ffffff;">${avo.result_a }</textarea></td>
					</tr>					
					</table>	
					<!-- 평가 의견 테이블  끝-->				
					</form>
			</td>
		</tr>
	</table>
</body>
</html>